/*
 * The MIT License (MIT)
 * Copyright © 2022 Walkline Wang (https://walkline.wang)
 * Gitee: https://gitee.com/walkline/ramcu-mechanical-keypad
 */
#ifndef UART_COMMON_H_
#define UART_COMMON_H_

/**
 * 全局变量
 */
extern volatile bool g_uart_usb_hid_recv_flag;
extern volatile uint8_t g_usb_hid_buffer[];
extern volatile uint8_t g_usb_hid_buffer_counter;

/**
 * 公有函数
 */
fsp_err_t uart_print_user_msg(uint8_t *p_msg);
fsp_err_t uart_initialize(void);

void uart_console_init(void);
void uart_usb_hid_init(void);

void uart_console_deinit(void);
void uart_usb_hid_deinit(void);

void uart_usb_hid_send(const uint8_t *data, uint8_t len);
fsp_err_t uart_usb_hid_read(uint8_t *data, uint8_t len);

#endif
